<?php

namespace bee;
/**
 *
 * @author dzelenika
 *
 */
class radio_old extends widget
{
  public $onChangeFn;
  public $drawMe;
 /**
 *
 * @var bool
 */
  public $checked;
  private $boundValue;
  function __construct($name, $value, &$bindValue = "", $id="")
  { parent::__construct($name, $id);
    //$this->checked = $checked;
    $this->value = $value;
    $this->boundValue = &$bindValue;
    if($this->value == $this->boundValue)
    { $this->checked = true;
    } else
    { $this->checked = false;
    }
    $this->drawMe = true;
  }
/**
 *
 * @param array $evt
 */
  public function onDraw($evt)
  { if($this->value == $this->boundValue)
    { $this->checked = true;
    } else
    { $this->checked = false;
    }
    $this->fillDSDoc();
  }

  /**
   *
   * @param sting $fillVar
   */
  public function fillDSDoc($fillVar = "")
  { if($fillVar && $this->checked)
    { $this->DSDoc->setVariable($fillVar, $this->value);
    }
    if($this->drawMe)
    {  $this->DSDoc->setObject("widgets/" . $this->name, $this, false);
    }
  }

}
